glob-base
Returns an object with the (non-glob) base path and the actual pattern.
Use glob-parent if you just want the base path.
Install with npm
npm i glob-base --save
Related projects
- glob-parent: Strips glob magic from a string to provide the parent path
- micromatch: Glob matching for javascript/node.js. A faster alternative to minimatch (10-45x faster on avg), with all the features you're used to using in your Grunt and gulp tasks.
- parse-glob: Parse a glob pattern into an object of tokens.
- is-glob: Returns
true
if the given string looks like a glob pattern. - braces: Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.
- fill-range: Fill in a range of numbers or letters, optionally passing an increment or multiplier to use.
- expand-range: Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.
Usage
var globBase = require('glob-base');
globBase('a/b/.git/');
globBase('a/b/**/e');
globBase('a/b/*.{foo,bar}');
globBase('a/b/.git/**');
globBase('a/b/c/*.md');
globBase('a/b/c/.*.md');
globBase('a/b/{c,d}');
globBase('!*.min.js');
globBase('!foo');
globBase('!foo/(a|b).min.js');
globBase('');
globBase('**/*.md');
globBase('**/*.min.js');
globBase('**/.*');
globBase('**/d');
globBase('*.*');
globBase('*.min.js');
globBase('*/*');
globBase('*b');
globBase('.');
globBase('.*');
globBase('./*');
globBase('/a');
globBase('@(a|b)/e.f.g/');
globBase('[a-c]b*');
globBase('a');
globBase('a.min.js');
globBase('a/');
globBase('a/**/j/**/z/*.md');
globBase('a/*/c/*.md');
globBase('a/?/c.md');
globBase('a/??/c.js');
globBase('a?b');
globBase('bb');
globBase('c.md');
Running tests
Install dev dependencies.
npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on March 08, 2015.